-
-
Couldn't load subscription status.
- Fork 2.7k
Make merchant accessible in PlayerPurchaseEvent
#13062
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds sensible, however now we are kinda doubling the #getVillager method in the PlayerTradeEvent as #getMerchant yields the same.
It might be beneficial to mark the #getVillager method as obsolete, overide the #getMerchant method to yield an AbstractVillager in PlayerTradeEvent and then have #getVillager link to it.
64ec554 to
5ae3fdc
Compare
You're absolutely right! I have made the changes as you said. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Neither of the events should be using jetbrains null-annotations, they are using jspecify already so should be fine without NotNull
5ae3fdc to
81774ec
Compare
Sure! I've corrected those. Could you please review again? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dont really agree with obsoleting getVillager, especially because trade event can only be a villager. Otherwise looks good
When using a custom merchant, it's common to want to know whether a recipe is just used by listening PlayerPurchaseEvent. However, if we couldn't know which merchant players are trading with, we can't reach that goal.
So I just simply add the approach.